<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/animate.min.css" rel="stylesheet">
    <link href="/static/css/main.css" rel="stylesheet">
    <link href="/static/css/page.css" rel="stylesheet">
    <link href="/static/css/responsive.css" rel="stylesheet">
    <link href="/static/iconfont/iconfont.css" rel="stylesheet" />
    <link href="/static/css/reset.css" rel="stylesheet" />
    <link href="/static/css/thems.css" rel="stylesheet" />


    <script src="/static/js/jquery.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    <script src="/static/js/jquery.SuperSlide.js" type="text/javascript"></script>
    <script src="/static/js/NSW_Index.js"></script>
    <script src="/static/js/jquery-1.11.3.js"></script>
</head>

<body>
    <header id="header">
        <nav class="navbar navbar-inverse" role="banner">
            <div class="container">
                <div class="row">
                    <div class="col-md-3 navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse"
                            data-target=".navbar-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="index.html"><img src="/static/images/logo.png" alt="logo"
                                class="img-responsive"></a>
                    </div>
                    <div class="col-md-9">
                        <div class="tel">24小时服务热线：<span>0755-29961998</span></div>
                        <div class="collapse navbar-collapse navbar-right">
                            <ul class="nav navbar-nav">
                                <li class="active"><a href="http://127.0.0.1:8000/publish/model_view/">订单类型</a></li>
                                <li><a href="http://127.0.0.1:8000/order/order_list_view/">我的订单</a></li>
                                <li><a href="http://127.0.0.1:8000/evaluation/list_view/">我的评价</a></li>
                                <li><a href="http://127.0.0.1:8000/user/user_view/">我的信息</a></li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </nav>
    </header>
    <div class="banner2">
        <p style="background:url(/static/images/sub_banner_about.jpg) no-repeat center; background-size:cover;"></p>
    </div>
    <div class="clearfix"></div>
    <section class="container">
        <div class="head">填写订单</div>
        <div class="r_ctn clearfix">
            <ul class="rent clearfix">
                <li class="clearfix">
                    <span class="title" align="left">订单类型：</span>
                    <div class="li_r">
                        <span id="mode_title">{{ model_title }}</span>
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title" align="left">下单人：</span>
                    <div class="li_r">
                        <input id="name" class="u_text" type="text">
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title" align="left">下单手机号：</span>
                    <div class="li_r">
                        <input id="phone" class="u_text" type="text">
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title" align="left">内容：</span>
                    <div class="li_r">
                        <input id="content" class="u_text" type="ar">
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title" align="left">下单金额：</span>
                    <div class="li_r">
                        <input id="price" class="u_text" type="text">
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title" align="left">地址：</span>
                    <div class="li_r">
                        <input id="address" class="u_text" type="text">
                    </div>
                </li>

                <li class="clearfix">
                    <span class="title" align="left">订单时间：</span>
                    <div class="li_r">
                        <input id="date_time" class="u_text" type="datetime-local">
                    </div>
                </li>
                <li class="clearfix">
                    <span class="title">&nbsp;</span>
                    <div class="li_r">
                        <input id="submit" class="u_save" type="button" value="提交">
                    </div>
                </li>
            </ul>
        </div>
    </section>

    <script>
        token = window.localStorage.getItem('moh_token');
        username = window.localStorage.getItem('moh_user');
        if (!username) {
            alert("请先登录")
            window.location.href = 'http://127.0.0.1:8000/user/login_view/';
        } else {
            $("#submit").on("click", function () {
                var name = $("#name").val()
                var phone = $("#phone").val()
                var content = $("#content").val()
                var price = $("#price").val()
                var address = $("#address").val()
                var date_time = $("#date_time").val()
                var mode_title = $("#mode_title").text()
                $.ajax({
                    type: "post",
                    url: "http://127.0.0.1:8000/publish/order_create/" + mode_title,
                    data: JSON.stringify({
                        "name": name,
                        "phone": phone,
                        "content": content,
                        "price": price,
                        "address": address,
                        "date_time": date_time
                    }),
                    headers: { 'Content-Type': "application/json" },
                    beforeSend: function (request) {
                        request.setRequestHeader("Authorization", token);
                    },
                    success: function (data) {
                        if (data.code == 200) {
                            alert('提交成功！');
                        } else {
                            alert(data.error);
                        }
                    },
                    error: function (e) {
                        alert(data);
                    }
                })
            })
        }

    </script>
    <section class="service-v1">
        <div class="container">
            <div class="row">
                <div class="col-sm-4 col-md-4 col-lg-4">
                    <div class="item">
                        <div class="icon">
                            <i class="iconfont">&#xe620;</i>
                        </div>
                        <div class="text">
                            <div class="inner">
                                <h3>正规公司，值得信赖</h3>
                                <p>工商注册备案，安全可靠！</p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-md-4 col-lg-4">
                    <div class="item">
                        <div class="icon">
                            <i class="iconfont">&#xe633;</i>
                        </div>
                        <div class="text">
                            <div class="inner">
                                <h3>安全保障，持证上岗</h3>
                                <p>三证齐全（身份证，健康证，育婴师证）疾病排查，身份联网确认</p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-md-4 col-lg-4">
                    <div class="item">
                        <div class="icon">
                            <i class="iconfont">&#xe614;</i>
                        </div>
                        <div class="text">
                            <div class="inner">
                                <h3>异地服务，更贴心</h3>
                                <p>专注母婴护理，你在哪，我们的服务就在哪里</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>


    <!--footer-->
    <footer id="footer">
        <div class="container">
            <span>
                <a href="http://127.0.0.1:8000/publish/model_view/">订单类型 </a>
                <a href="http://127.0.0.1:8000/order/order_list_view/">我的订单</a>
                <a href="http://127.0.0.1:8000/evaluation/list_view/">我的评价</a>
                <a href="http://127.0.0.1:8000/user/user_view/">我的信息</a>
            </span>
            <span>联系地址：深圳宝安西乡街道兴业路西南侧碧海富通城1栋110 &nbsp;&nbsp; 联系方式：0755-29961998<br>
                Copyright © 2005-2023 All rights reserved. 京ICP备10012705号-8 </span>
        </div>
    </footer>
</body>

</html>